package com.aidex.system.service.impl;

import java.util.List;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.system.mapper.RunLogMapper;
import com.aidex.system.domain.RunLog;
import com.aidex.system.service.RunLogService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 运单接收日志Service业务层处理
 * @author jmy
 * @email jmyinjg@163.com
 * @date 2021-11-09
 */
@Service
@Transactional(readOnly = false)
public class RunLogServiceImpl extends BaseServiceImpl<RunLogMapper, RunLog> implements RunLogService
{
    private static final Logger log = LoggerFactory.getLogger(RunLogServiceImpl.class);

    /**
     * 获取单条数据
     * @param runLog 运单接收日志
     * @return 运单接收日志
     */
    @Override
    public RunLog get(RunLog runLog)
    {
        RunLog dto = super.get(runLog);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 运单接收日志id
     * @return 运单接收日志
     */
    @Override
    public RunLog get(String id)
    {
        RunLog dto = super.get(id);
        return dto;
    }


    /**
     * 查询运单接收日志列表
     * @param runLog 运单接收日志
     * @return 运单接收日志
     */
    @Override
    public List<RunLog> findList(RunLog runLog)
    {
        return super.findList(runLog);
    }

    /**
     * 分页查询运单接收日志列表
     * @param runLog 运单接收日志
     * @return 运单接收日志
     */
    @Override
    public PageInfo<RunLog> findPage(RunLog runLog)
    {
        return super.findPage(runLog);
    }

    /**
     * 保存运单接收日志
     * @param runLog
     * @return 结果
     */
    @Override
    public boolean save(RunLog runLog)
    {
        return super.save(runLog);
    }
    @Override
    public boolean saveError(String api,String errMsg)
    {
        RunLog log = new RunLog();
        log.setApiError(errMsg);
        log.setApiType(api);
        return super.save(log);
    }


    /**
     * 删除运单接收日志信息
     * @param runLog
     * @return 结果
     */
    @Override
    public boolean remove(RunLog runLog)
    {
        return super.remove(runLog);
    }

    /**
     * 批量删除运单接收日志
     * @param ids 需要删除的运单接收日志ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteRunLogByIds(String[] ids)
    {
        return mapper.deleteRunLogByIds(ids);
    }

}
